package spring.superrun.record.mvc.service;

import com.sun.istack.internal.NotNull;
import spring.superrun.record.mvc.dto.CompleteToken;
import spring.superrun.record.mvc.dto.TokenBody;
import spring.superrun.record.mvc.entity.SuperrunUserinfos;

import javax.validation.constraints.NotEmpty;

/**
 * JwtToken服务接口
 */
public interface JwtTokenService {
    /**
     * 创建完整token包含AccessToken和RefreshToken
     * @param user
     * @return
     */
    public CompleteToken CreateToken(@NotNull SuperrunUserinfos user);

    /**
     * 根据RefreshToken返回AccessToken
     * @param refreshToken
     * @return
     */
    public TokenBody CreateAccessToken(@NotEmpty String refreshToken);
}
